473,480 Members | 1,995 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Drop Down Navigation Menu Not Lining Up...

58 New Member
Hey everyone-

This is my first post at The Scripts, but I've used the forums before for other programming issues. Hopefully, someone has some solid styling advice for me.

I've now been dealing with XHTML/CSS for about a week. I'm trying to set up a website for my dad, and this navigation menu is driving me nuts.

I designed this part of the site on Firefox 2.0.

Here's the link: http://www.yalestartups.com/tburger/test.html

If you open it in Firefox, the navigation works as designed. Drop-down boxes appear under each link, and the link changes color upon mouse-over.

The problem occurs when I open the page in other browsers. Even though I've put the navigation menu on a separate z-index and positioned it absolutely, I want it to line up the way it does in Firefox.

I assume this is a cross browser issue - and I've tried to globally change the margins and padding to accommodate this...

But I think it may be something else, because the :hover behaviors don't act the same in other browsers either.

This could be blatantly obvious, but I'm new...

Any help, comments, advice would be appreciated...I've really enjoyed working on this first site, and would like to get more seriously involved with web design...

Thanks,

Tom

------------CSS File

/* Universal Browser Accomodation */

* {
padding:0;
margin:0;
}



/* Body: Format Color / Margins */

body{
margin: 0;
padding: 0;
background: #333333;
}

/*-------Central Content Box id = "container"-------*/

#container{
width: 850px;
height: auto;
position: absolute;
top:0;
left:50%;
margin-left: -425px;
background: white;
border-left: solid 1px black;
border-right: solid 1px black;
border-bottom: solid 2px black;
z-index:1;

}

/*---------Primary Text Box id = "textbox"---------*/

#textbox{
width: 640px;
height: auto;
padding-left: 200px;
padding-top: 0px;
}

/* Content Styling */

h1{
font-family: Geneva;
font-size: 24px;
color: #0066CC;
border-bottom: solid 2px #cc9900;
}

p{

font-family: geneva;
font-size: 16px;
}

/*-------Page Background Structure----------*/

/* Background Table */

table{
width: 850px;
height: 259px;
border-bottom: solid 1px black;
}

/* Table Column Definitions */
td.left{
width: 339px;
}

td.right{
width: 511px;
}
#navleft{
margin:0;
height:133px;
background-image:url(topleft.gif);
}

#navbleft{
margin:0;
height:125px;
background-image:url(botleft.gif);
}

#navright{
margin:0;
height: 133px;
background-image: url(topright.gif);
}
#navbright{
margin:0;
height: 125px;
background-image: url(botright.gif);
}

/*------Top Navigation Menu------------*/

dt{
min-height:30px;
}
#dropmenu{
position: absolute;
top: 37px;
left: 474px;
z-index:3;
}
#dropmenu dl{
float: left;
}

#dropmenu dt{
cursor: pointer;
}

#dropmenu dd{
float: left;
text-align: left;
margin-top: -4px; /*IMPORTANT Overlap with "dt" for Clean Navigation*/
margin-left: 10px;
width: 125px;
background-color: #999999;
border: solid 1px black;
}

#dropmenu a.slink{
font-family: Geneva, Arial, Helvetica, sans-serif;
font-size: 12px;
text-decoration: none;
color: white;
}

#dropmenu li{
text-align: left;
height:auto;
display: block;
width:auto;
margin-left: 5px;
margin-top: 2px;
margin-bottom: 4px;
}

#dropmenu a.slink:hover{
color: #660000;
}

#dropmenu li:hover{
border-bottom: dotted 3px #CC9900;
}


/* Secondary (Lower) Link Positioning */
#lownav{
position: absolute;
top: 75px;
left: 765px;
z-index: 2;
}

/* Top Link Styling */
a.nav, a.lownav{
margin-left: 14px;
color: white;
font-family:Geneva, Arial, Helvetica, sans-serif;
font-size: 14px;
text-decoration: none;
}

a.lownav{
margin-left: 10px;
}


/* Top Link Hover Actions*/
a.nav:hover,a.lownav:hover{
color:#CC9900;
}

/*------Side Navigation Box------------------*/

#snav{
margin-top: 0px;
margin-bottom: 0px;
float: left;
width: 185px;
min-height: 500px;
background-color: #5A594A;
border-right: solid 1px black;
clear: left;
}

/* Side Link Styling*/

/* One Line Link Definitions */
a.snavone{
margin-top: 12px;
float: left;
width: 173px;
height: 30px;
background-color: #003366;
border-top: solid 2px black;
border-right: solid 2px black;
border-bottom: solid 2px black;
text-decoration: none;
}

/* Two Line Link Definitions */
a.snavtwo{
margin-top: 12px;
float: left;
width: 173px;
height: 47px;
background-color: #003366;
border-top: solid 2px black;
border-right: solid 2px black;
border-bottom: solid 2px black;
text-decoration: none;
}

/* Side Link Spacing */
span.snavtext{
padding-top: 5px;
padding-left: 12px;
display: block;
text-align: left;
color: white;
font-family: Geneva, Arial, Helvetica, sans-serif;
font-size: 14px;
}

/* Side Link Hover Action */
a.snavone:hover, a.snavtwo:hover{
background-color:#660000;
}


/* -------Page Footer-------*/
#footer{
margin: 0;
float: left;
clear: left;
width: 850px;
height: 24px;
background-image: url(foot.gif);
background-repeat: repeat-x;
font-family: Geneva, Arial, Helvetica, sans-serif;
font-size: 11px;
border-top: solid 1px black;
}

/* Footer Text Styling */
#footttext{
display: block;
text-align:center;
margin-top: 6px;
color: white;
}

/* Footer Dividers */
span.yell{
color: #CC9900;
}
Jul 13 '07 #1
4 3975
drhowarddrfine
7,435 Recognized Expert Expert
In your doctype:
<!DOCTYPE html PUBLIC ?-//W3C//DTD XHTML

The question mark should be a quote ".

This puts IE into quirks mode and it won't attempt to work like modern browsers. Maybe not the real issue but try it.
Jul 13 '07 #2
tburger
58 New Member
Thanks...I tried this, but I think it has something to do with the positioning ultimately...I don't understand why some elements seem unaffected while others, like the navigation menu and text area, look great in Firefox, but horrible in other browsers...
Jul 13 '07 #3
tburger
58 New Member
I figured out what was wrong:

I had been positioning the div box containing the navigation menu absolutely from the top left of the PAGE. Since the distance from my main container div varies in different browsers, this was throwing off the alignment. What I needed to do was position the navigation menu absolutely from the top left of the CONTAINER DIV. Once I did this, the navigation seemed to work properly...

Does anyone know how Safari handles ":hover" behaviors? The proper mouse-over effect occures in Firefox and Camino, but not in Safari? Any advice?
Jul 14 '07 #4
drhowarddrfine
7,435 Recognized Expert Expert
hover works fine in Safari. Must be something else.
Since the distance from my main container div varies in different browsers
Don't know why that would be since you set margins to zero.
Jul 14 '07 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

2
3171
by: Yve | last post by:
Hello, I am new here and received good advice many times before by just reading - now I would like to ask this question: I have got a frameset of 5 frames: navigation and 4 content-frames. How...
3
2931
by: KK | last post by:
Drop-down menus are the hottest thing since Wonder Bread but . . . 1. Alot of people put them in the they-look-nice-but-you-cant-code-them-right-so-they-always-look-messed-up category (a la...
8
3536
by: Yeah | last post by:
I wish to use a drop box where each Option will not take the user to a web page - but a certain location on the same page the drop box exists. For example, Option 1 would take the user to "Chapter...
1
1568
by: ngoc | last post by:
Hi I want to build dropdown navigation menu. Searching from google gives many commercial programs -> Not easy to choose. And I want to make it myself. Are there any good tutorials to build...
3
1934
by: Andrew | last post by:
Hello, friends, I was asked to implement a .aspx page with drop down menus. When a mouse pointer moves over a menu bar, a drop down list containing sub-menus will show up. Thus a user may select...
3
1864
by: lewisthesmith | last post by:
I'm not really sure if this is a CSS issue, but people here before have been knowledgeable and friendly and so it seems like a good place to start. I'm in the process of building a new site for...
2
5658
by: Steve Richter | last post by:
I would like to have a standard site navigation menu, horizontal across the page, at the top of the page. When I hover over a top level menu item I want a drop down menu to appear with the same...
1
1470
by: ralfie7 | last post by:
Is it possible to create a pure CSS (no JS) horizontal drop-down navigation menu using only css AND use includes for that navigation item? Most of the examples I see do not put their navigation in an...
0
1257
by: aboutjav.com | last post by:
Hi, I am new at asp.net and want to add a horizontal dropdown menu like toolstripmenu in windows form. I found a drop down menu written in javascript (DHTML). How do I add to my asp.net project....
0
7051
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
6915
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7097
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
6993
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5353
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
3003
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
2993
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1307
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
567
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.